//cookie保存天数
const COOKIE_SAVE_TIME = 2;
/*@props
 * 设置Cookie
 */
export function setCookie(name, value) {
  let d = new Date;

  d.setTime(d.getTime() + 24*60*60*1000*COOKIE_SAVE_TIME);

  window.document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString();
}
/*@props
 * 获取Cookie
 */
export function getCookie(name) {
  let v = window.document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');

  return v ? v[2] : null;
}
